import VueRouter from 'vue-router'
import Vue from 'vue'
import Login from './views/Login.vue'
import UserInfo from './views/UserInfo.vue'
import Course from './views/Course.vue'
import Work from './views/Work.vue'
import Live from './views/Live.vue'
import CourseInfo from './views/CourseInfo.vue'

//使用 vue-router
Vue.use(VueRouter)

//配置 router信息
const routes = [{
        path: '/',
        redirect: 'login'
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/user',
        component: UserInfo
    },
    {
        path: '/course',
        name: "Course",
        component: Course,
    },
    { path: '/course/info', component: CourseInfo, name: "CourseInfo" },
    {
        path: '/work',
        component: Work
    },
    {
        path: '/live',
        component: Live
    }
]

const router = new VueRouter({
    routes
})

export default router;